# # 文件打开open(name, mode, encoding),encoding=utf-8,mode:r,w,x
# #  打开文件 open()获取一个文件对象
# f = open("111222.txt", "r", encoding="utf-8")
# # 读取用read（）
# print(f.read())
#
# # 用with open（） as file：
# with open("111222.txt", "r", encoding="utf-8") as flie:
#     text = flie.read()
# print(text)
#
# # 使用绝对路径
# ff = open(r"C:\Users\Administrator\Desktop\111222.txt", encoding="utf-8")
# print(ff.read())
# # 写文件write（） .close() 保存
# fff = open("222.txt", "w", encoding="utf-8")
# fff.write("hello,python")
# fff.close()
#
# data ="！你好！"
# with open("222.txt", "a", encoding="utf-8") as flie:
#     f.write(data)
#
# import math
# # 处理excel文件时用pandas
# import pandas
#
#
#
# # # 文件打开open(name, mode, encoding),encoding=utf-8,mode:r,w,x
# # #  打开文件 open()获取一个文件对象
# # import pandas as pd
# #
# # f = open("111222.txt", "r", encoding="utf-8")
# # # 读取用read（）
# # print(f.read())
# #
# # # 用with open（） as file：
# # with open("111222.txt", "r", encoding="utf-8") as flie:
# #     text = flie.read()
# # print(text)
# #
# # # 使用绝对路径
# # ff = open(r"C:\Users\Administrator\Desktop\111222.txt", encoding="utf-8")
# # print(ff.read())
# # # 写文件write（） .close() 保存
# # fff = open("222.txt", "w", encoding="utf-8")
# # fff.write("hello,python")
# # fff.close()
# #
# # data ="！你好！"
# # with open("222.txt", "a", encoding="utf-8") as flie:
# #     f.write(data)
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
# import pandas
#
# # 写文件到excel
# a1 = {"name": "xiaohong", "nianling": 20}
# a2 = {"name": "xiaoliu", "nianling": 20}
# a3 = {"name": "xiaobai", "nianling": 20}
# l = [a1, a2, a3]
# # 将列表变成dateframe
# df1 = pandas.DataFrame(l)
# print(df1)
# # 使用pandas函数.to_excel()  index=False   不索引
# df1.to_excel("111.excel",index=False)